package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.common.dto.CategoryDTO;
import com.leyou.item.entity.Category;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;

@Component
public interface CategoryMapper extends BaseMapper<Category> {
  @Select("select tc.id\n" +
            "from tb_category_brand tcb,tb_category tc\n" +
            "where tcb.category_id = tc.id and tcb.brand_id=#{pid}")
     List<Long> findCategoryByBid(@Param("pid") Long pid);
}
